<?php
    class CF_Controller_Action extends Zend_Controller_Action { 

    public function init()
    {
        $acl = Zend_Registry::get('acl');
        $this->view->acl = $acl;
        
        $auth = Zend_Auth::getInstance();

        
        //var_dump($auth->getStorage()->read());
        
        
        if ($auth->hasIdentity() && isset($auth->getStorage()->read()->acces_level))
        {
            $role = $auth->getStorage()->read()->acces_level;
        }
        else
        {
            $role = null;
        }

        $contr = $this->getRequest()->controller;
        $act = $this->getRequest()->action;
        
        if($acl->isAllowed($role, $contr, $act))
        {
        
        }
        else
        {
            $this->_redirect('/auth/login/');                
        } 
                
        
        
    }
    
    public function testAction(){
    
    }    
}